package cn.stylefeng.guns.modular.basic.service;

import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.modular.basic.entity.BasicGoods;
import cn.stylefeng.guns.modular.basic.model.params.BasicGoodsParam;
import cn.stylefeng.guns.modular.basic.model.result.BasicGoodsResult;
import cn.stylefeng.guns.modular.replenishment.model.result.BHStorageStockResult;
import cn.stylefeng.roses.core.reqres.response.ResponseData;

import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.web.multipart.MultipartFile;

/**
 * <p>
 * 商品表 服务类
 * </p>
 *
 * @author hu
 * @since 2019-06-28
 */
public interface BasicGoodsService extends IService<BasicGoods> {

    /**
     * 新增
     *
     * @author hu
     * @Date 2019-06-28
     */
    void add(BasicGoodsParam param);

    /**
     * 删除
     *
     * @author hu
     * @Date 2019-06-28
     */
    void delete(BasicGoodsParam param);

    /**
     * 更新
     *
     * @author hu
     * @Date 2019-06-28
     */
    void update(BasicGoodsParam param);

    /**
     * 查询单条数据，Specification模式
     *
     * @author hu
     * @Date 2019-06-28
     */
    BasicGoodsResult findBySpec(BasicGoodsParam param,Long operateId);

    /**
     * 查询分页数据，Specification模式
     *
     * @author hu
     * @Date 2019-06-28
     */
     LayuiPageInfo findPageBySpec(BasicGoodsParam param, String condition, Long deptId, Long operateId);

    /**
     * 查询商品
     * @param basicGoodsParam
     * @param deptId
     * @param condition 
     * @return
     */
    List<BasicGoodsResult> findListBySpec(BasicGoodsParam basicGoodsParam, Long operateId);

	ResponseData getExceldata(MultipartFile file, BasicGoodsParam basicGoodsParam, ResponseData data) throws Exception;

	ResponseData getExceldataUpadate(MultipartFile file, BasicGoodsParam basicGoodsParam, ResponseData data) throws Exception;
	
	void updateBySpec(BasicGoodsParam param);
	
	boolean saveBatchList(List<BasicGoodsParam> list);

	List<BasicGoodsResult> findListBySpecNew(BasicGoodsParam basicGoodsParam, Long deptId, String condition,Long operateId);

	Integer addReturnId(BasicGoodsParam param);

	Workbook exportToExcel(BasicGoodsParam basicGoodsParam);

	List<BasicGoodsResult> findListBySpecSd(BasicGoodsParam basicGoodsParam);

    List<BHStorageStockResult> findStorageStockByGoodsNumber(String positionType ,String goodsNumber, long l);

    BHStorageStockResult findStorageStockByGoodsNumberNew(String positionType, String detailedGoodsCode, long l);
}
